package com.day12;
abstract class Animal{
    public abstract void eat();
}
class Cat extends Animal{
    public void eat(){
        System.out.println("eat fish");
    }
}
class AnimalOperator{
    public void useAnimal(Animal a){
        a.eat();
    }
    public Animal getAnimal(){
        Animal a= new Cat();
        return a;
    }
}
public class AnimalDemo {
    public static void main (String[] args){
        AnimalOperator ao=new AnimalOperator();
        Animal a=new Cat ();
        ao.useAnimal(a);
        Animal a2=ao.getAnimal();
        a2.eat();
    }
}
